Repository navigation
Desktop: a window the relay refused goes back through its entry, never left on the refusal - #2883
Queued
davidmckayv wants to merge 1 commit into
Queued
davidmckayv wants to merge 1 commit into
davidmckayv wants to merge 1 commit into
Conversation
…r left on the refusal Connected through the relay, the window's page load could come without the run's cookie, and the relay answered its refusal, a white page with no script that says only "This relay is for the OpenBot window." Show Window (the Dock, the tray, a second launch) took any address on the relay's origin to be showing OpenBot already, the refusal included, so opening the window again left it there; only a quit, which starts a new relay and enters it, got the person back. Reported on 1.2.0-rc.5 connected to OpenBot Cloud. The relay now keeps the path of a page load it refused until the window enters again or a page load passes, and writes every refusal to the log with why (method and path only, never the secret). A page load in the window that ends on that refusal goes back through the entry at the same page by itself (at most once in 5 seconds and three times a minute), and opening the window again does the same every time. A request of the page's own that comes without the cookie (Sec-Fetch-Site: same-origin) tells the shell, which sends the window through the entry at the page it shows. Nothing else changes about what the relay accepts: another site's page and another program are still refused and never reach OpenBot.
davidmckayv
marked this pull request as ready for review
December 3, 2026 18:41
davidmckayv
requested review from
MikeRyanDev,
dustywusty,
guidovizoso,
mxmzb,
samjulien and
tylerslaton
as code owners
December 3, 2026 18:41
davidmckayv
added this pull request to the merge queue
Dec 3, 2026
Any commits made after this event will not be merged.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Desktop connected to OpenBot Cloud through the relay could leave its window on the relay's own refusal, a white page that says only "This relay is for the OpenBot window.", with no way back short of quitting the app. Reported in dogfooding on 1.2.0-rc.5: closing the window and opening it again from the Dock didn't help; quitting did.
What happened
From the two troubleshooting logs:
[relay] listening on 127.0.0.1:59128, then[relay] stoppedonly at the quit). No second instance, no second relay, and the window loaded well after the relay was up and worked for a day.ENTER_PATH) can't have refused: the window only goes there with the live relay's own secret. So it was the check every other request meets: no foreignOrigin(a page load sends none), so either no cookie orSec-Fetch-Sitesaying another site. The window's page load came without the cookie.show_window, which takes any address on the relay's origin to be "already showing OpenBot", the refusal included, and leaves the window there. A quit stops the relay, and the next launch starts a new one and sends the window through its entry, which hands it a fresh cookie. That is why only the quit helped.Nothing in 1.2.9 changed this; the relay's checks and the window's way back are the same on main as in rc.5. A Desktop that signed in through the relay before 1.2.8 still shows OpenBot through it until the person next signs in, so this still matters on current releases.
What changed
Sec-Fetch-Dest: document, or a GET for HTML from a webview that sends noSec-Fetch-Dest) until the window enters again or a page load passes, and writes every refusal to the log with why (another site's origin, another site, no cookie). Method and path only, never a header or the secret. Refused requests that aren't page loads are written at most every 30 seconds.Sec-Fetch-Site: same-origin, which no other site's page can send) tells the shell, which sends the window back through the entry at the page it shows.Tests
Regression, red before and green after:
a_window_the_relay_refused_goes_back_through_the_entry_when_it_is_opened_again(the shell, with a real relay in front of an OpenBot stand-in). The window is signed in through the relay, enters, loses the cookie, and its page load is refused with that exact sentence; then Show Window. Before the fix:After: the window goes to the entry, gets the same run's cookie, and its page loads.
a_page_load_the_relay_refused_enters_the_relay_again_by_itself: the refused load ends and the window goes back through the entry at that page with nobody opening it, once; a refusal straight after is left to the person, and opening the window then still enters.the_windows_page_asking_without_the_cookie_enters_the_relay_again: the page's own request without the cookie sends the window back through the entry.The relaunch path,
a_quit_and_the_next_launch_give_the_window_a_new_relay_it_enters: quit stops the relay, the next launch starts one with a secret of its own and sends the window through its entry, its page loads, and the last run's cookie opens nothing.In the relay,
a_page_load_refused_for_want_of_the_cookie_is_kept_until_the_window_enters_again, with the WebKit window stand-in now sending a page load'sAcceptandSec-Fetch-*headers: the refused page is kept, a fetch is never taken for a page load, only the page's own same-origin request tells the shell, and the entry at that page lets the window back in.cargo test --lib connected::, the shell's connected tests,cargo fmt --checkandcargo clippy --all-targets -D warningspass locally.No screen changed: the refusal itself is the same page, and the window now leaves it. No Desktop screenshots, because getting a real WKWebView to drop the relay's session cookie on demand isn't something I could reproduce locally; the report's screenshot is the before. No install or upgrade path is touched.
Changelog
OpenBot Desktop.